/**
 * 
 */
package com.informatica.powercenter.sdk.mapfwk.samples;

import com.informatica.powercenter.sdk.mapfwk.connection.ConnectionAttributes;
import com.informatica.powercenter.sdk.mapfwk.exception.RepoConnectionObjectOperationException;
import com.informatica.powercenter.sdk.mapfwk.repository.PmrepRepositoryConnectionManager;
import com.informatica.powercenter.sdk.mapfwk.repository.RepoConnectionInfo;
import com.informatica.powercenter.sdk.mapfwk.repository.Repository;
import com.informatica.powercenter.sdk.mapfwk.repository.RepositoryConnectionManager;

/**
 * @author sramamoo
 *
 */
public class DeleteConnectionSample
{
	public static void main(String[] args)
	{
		RepositoryConnectionManager rpMgr = new PmrepRepositoryConnectionManager();
		Repository myRepo = new Repository();
		RepoConnectionInfo repoConnectionInfo = new RepoConnectionInfo();
		repoConnectionInfo.setPcClientInstallPath("C:\\Informatica\\PowerCenter8.1.1\\client\\bin");
		repoConnectionInfo.setTargetRepoName("PowerCenter");
		repoConnectionInfo.setRepoServerHost("infabia");
		repoConnectionInfo.setRepoServerPort("6001");
		repoConnectionInfo.setAdminPassword("Administrator");
		repoConnectionInfo.setAdminPassword("Administrator");
		
		myRepo.setRepoConnectionInfo(repoConnectionInfo);
		myRepo.setRepositoryConnectionManager(rpMgr);
		rpMgr.setRepository(myRepo);
						
		try
		{
			myRepo.deleteConnection(ConnectionAttributes.CONN_TYPE_RELATIONAL, "myConn1");
			
		} catch (RepoConnectionObjectOperationException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
	}
}
